package com.example.makerspace.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.makerspace.domain.CompetitionSubmissionDO;
import com.example.makerspace.vo.CompetitionSubmissionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CompetitionSubmissionMapper extends BaseMapper<CompetitionSubmissionDO> {


    @Select("SELECT * FROM makerspace.t_competition_submission where state=#{name}  ORDER BY create_time  DESC")
    List<CompetitionSubmissionVO> getCompetitionSumbission(Page<CompetitionSubmissionVO> page, String name);

    @Select("SELECT * FROM makerspace.t_competition_submission   ORDER BY create_time  DESC")
    List<CompetitionSubmissionVO> getCompetitionSumbissionNO(Page<CompetitionSubmissionVO> page);

    List<CompetitionSubmissionVO> selectByPageNameAndState(Page<CompetitionSubmissionVO> page, String name, String state);
}
